<tr data-role='item'>
  <td><input value="{{question.id}}" type="checkbox"  autocomplete="off" data-role="batch-item" ></td>
  <td>
    <a href="#modal" data-toggle="modal" data-url="{{ path('course_manage_question_preview', {id:question.id, courseId:course.id}) }}">
      {% if question.includeImg %}<span class="glyphicon glyphicon-picture"></span>{% endif %}
      {{ question.stem |fill_question_stem_text| plain_text(40) }}
    </a>
    <div>
      {% set target = targets[question.target]|default(null) %}
      {% if target.type|default(null) != 'course' %}
        <small class="text-muted">{{'从属于%simple_name%'|trans({'%simple_name%': targets[question.target].simple_name|default(''|trans)})}}</small>
      {% else %}
        <small class="text-muted">{{'从属于 本课程'|trans}}</small>
      {% endif %}
      {% if question.type == 'material'%}
        {% if  question.subCount == 0  %}
          <span class="label label-danger">{{'未完成'|trans}}</span>
        {% endif %}
      {% endif %}
    </div>

  </td>
  <td>
  {{ dict('questionType')[question.type] }}
  {% if question.type == 'material'%}<br><small class="text-muted">({{ question.subCount }}{{'子题'|trans}})</small>{% endif %}
  </td>
  <td>
    {{ macro.user_link(users[question.userId]) }}
    <br />
    <span class="text-muted text-sm">{{question.updatedTime | date('Y-n-d H:i:s')}}</span>
  </td>
  <td>
    <div class="btn-group">
      <a class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal" data-url="{{ path('course_manage_question_preview', {id:question.id, courseId:course.id}) }}">{{'预览'|trans}}</a>
      <a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
      <ul class="dropdown-menu pull-right">
        {% if question.type == 'material'%}
          <li><a href="{{ path('course_manage_question',{courseId:course.id, parentId:question.id}) }}"><span class="glyphicon glyphicon-list"></span> {{'管理子题'|trans}}</a></li>
        {% endif %}
        <li><a href="{{ path('course_manage_question_update', {courseId:course.id,id:question.id, goto:app.request.server.get('REQUEST_URI')}) }}"><span class="glyphicon glyphicon-edit"></span> {{'编辑'|trans}}</a></li>
        <li><a href="javascript:" data-name='{{'题目'|trans}}{% if question.type == 'material'%}({{'含子题'|trans}}){% endif %}' data-role='item-delete' data-url="{{ path('course_manage_question_delete', {courseId:course.id, id:question.id}) }}"><span class="glyphicon glyphicon-remove-circle"></span> {{'删除'|trans}}</a></li>
      </ul>
    </div>
  </td>
</tr>
